package com.example.parkingproject.service.serviceImp;

import com.example.parkingproject.jopo.entity.Comment;
import com.example.parkingproject.mapper.CommentMapper;
import com.example.parkingproject.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CommentServiceImp implements CommentService {
    @Autowired
    CommentMapper commentMapper;

    @Override
    public void newComment(Comment comment) {
        comment.setCreateTime(new Date());
        commentMapper.newComment(comment);
    }

    @Override
    public List<Comment> getCommentList(Integer locationNumber) {
        List<Comment> list = commentMapper.getCommentList(locationNumber);
        return list;
    }
}
